import 'app_product.dart';

///产品列表
class AppProductList{
  List<AppProduct>? appProduct=[];
  List<AppProduct>? headerAppProduct=[];//头部vip

  AppProductList({this.appProduct=const[],this.headerAppProduct=const[]});

  AppProductList.fromJson(Map<String, dynamic> json) {
    if (json['rows'] != null) {
      appProduct = <AppProduct>[];
      json['rows'].forEach((v) { appProduct!.add(new AppProduct.fromJson(v)); });
    }

    if (json['header'] != null) {
      headerAppProduct = <AppProduct>[];
      json['header'].forEach((v) { headerAppProduct!.add(new AppProduct.fromJson(v)); });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.appProduct != null) {
      data['rows'] = this.appProduct!.map((v) => v.toJson()).toList();
    }

    if (this.headerAppProduct != null) {
      data['header'] = this.headerAppProduct!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}